home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 08 - 1992 / 08.02 Jun 92 / Generic Virus Detection / Dec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-26  |  1.4 KB  |  62 lines  |  [TEXT/MPS ]

  1. /* dec.h - dynamic definitions and declarations */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <math.h>
  7.  
  8. #define FALSE            0
  9. #define TRUE            1
  10. #define NO_REPORT        -1
  11.  
  12. #define K            1024
  13. #define MAXSIZE        8*K
  14. /* All of the tweaking is done here */
  15. #define UNIT            1
  16. #define EPSILON        1
  17. #define THRESHOLD        UNIT*50
  18.  
  19. #define READ_MODE        "r"
  20. #define WRITE_MODE        "w"
  21. #define APPEND_MODE        "a"
  22.  
  23. #define MIN2(a, b)    (((a) < (b)) ? (a) : (b))
  24. #define MIN3(a, b, c)    ((MIN2((a), (b)) < (c)) ? MIN2((a), (b)) : (c))
  25. #define MAX2(a, b)    (((a) > (b)) ? (a) : (b))
  26.  
  27. #define NIL_POINTER        0L
  28. #define NIL_STRING        "\p"
  29. #define IGNORED_STRING    NIL_STRING
  30. #define NIL_FILE_FILTER     NIL_POINTER
  31. #define NIL_DIALOG_HOOK NIL_POINTER
  32. #define VDAT_RES_ID        0
  33.  
  34. typedef long **MATRIX;
  35.  
  36. void initialize(), clear_table(), vResCheck(), allocate_table(), error_message(), exit_cleanly(), main();
  37. char open_file(), compare();
  38. int read_array();
  39.  
  40. int copy_array(array1, array2, bytes_left)
  41. char array1[], array2[];
  42. int *bytes_left;
  43. {
  44.   int bytes_gotten = 0;
  45.   if (!(*bytes_left))
  46.     return (FALSE);
  47.   if (*bytes_left < MAXSIZE)
  48.   {
  49.     memmove ((void *)array2, (void *)array1,     (size_t)(*bytes_left));
  50.     bytes_gotten = *bytes_left;
  51.     *bytes_left = 0;
  52.   }
  53.   else
  54.   {
  55.     memmove ((void *)array2, (void *)array1,     (size_t)MAXSIZE);
  56.     bytes_gotten = MAXSIZE;
  57.     *bytes_left -= MAXSIZE;
  58.   }
  59.   return (bytes_gotten);
  60. }
  61.  
  62.